#set(entityClass = table.entityClass())
package #(basePackage).#(table.moduleType).#(table.moduleName).#(table.domainName).enums;

import com.goldsyear.dolphin.framework.common.core.exception.ErrorCode;

// ========== #(table.classComment) ==========

/**
 * @author #(table.author)
 */
public interface #(entityClass)ErrorCode {
    //TODO： 修改错误代码编号，将 0 修改成对应的错误编号
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_NOT_EXISTS = new ErrorCode(0, "#(table.classComment)不存在");
    ### 特殊：树表专属逻辑
    #if(table.templateType == 2)
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_EXITS_CHILDREN = new ErrorCode(0, "存在存在子#(table.classComment)，无法删除");
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_PARENT_NOT_EXITS = new ErrorCode(0,"父级#(table.classComment)不存在");
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_PARENT_ERROR = new ErrorCode(0, "不能设置自己为父#(table.classComment)");
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_#(treeNameColumn_javaField_underlineCase.toUpperCase())_DUPLICATE = new ErrorCode(0, "已经存在该#(treeNameColumn.columnComment)的#(table.classComment)");
    ErrorCode #(simpleClassName_underlineCase.toUpperCase())_PARENT_IS_CHILD = new ErrorCode(0, "不能设置自己的子#(table.className)为父#(table.className)");
    #end
    ### 特殊：主子表专属逻辑
    #if(table.templateType == 11)### 特殊：ERP 情况
    #for(subTable : subTables)
    #set(index = for.index)
    #set(simpleClassNameUnderlineCase = simpleClassNameUnderlineCases.get(index))
    ErrorCode #(simpleClassNameUnderlineCase.toUpperCase())_NOT_EXISTS = new ErrorCode(0, "#(subTable.classComment)不存在");
    #if (!subTable.subJoinMany)
    ErrorCode #(simpleClassNameUnderlineCase.toUpperCase())_EXISTS = new ErrorCode(0, "#(subTable.classComment)已存在");
    #end
    #end
    #end
}
